//
//  ZYPopViewController.swift
//  SwiftDemo1
//
//  Created by wangzhipan on 2025/6/3.
//

import Foundation
import UIKit

class ZYPopViewController: UIViewController {
    
    private var imageView = UIImageView()
    private var tableView = UITableView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .clear
        setupUI()
        layoutUI()
    }
}

// MARK: -UI
extension ZYPopViewController {
    private func setupUI() {
        let bubbleImage = UIImage(named: "popover_background")
        let stretchableInsets = UIEdgeInsets(top: 20, left: 0, bottom: 20, right: 0)
        let resizeImage = bubbleImage?.resizableImage(withCapInsets: stretchableInsets, resizingMode: .stretch)
        imageView.image = resizeImage
        
        view.addSubview(imageView)
        
//        tableView.delegate = self
//        tableView.dataSource = self
        
        view.addSubview(tableView)
    }
    
    private func layoutUI() {
        imageView.snp.makeConstraints { make in
            make.edges.equalTo(UIEdgeInsets.zero)
        }
        
        tableView.snp.makeConstraints { make in
            make.edges.equalTo(UIEdgeInsets(top: 15, left: 15, bottom: 10, right: 15))
        }
    }
}

//extension ZYPopViewController: UITableViewDelegate, UITableViewDataSource {
//    
//}
